﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using control.Biz;
using System.Collections.Generic;

namespace TrangSucShop
{
    public partial class categories : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //chung ta se lay list cac san pham thuoc categories dua vao IDLoai tren url
            if (Request.QueryString["IDLoai"] != null) // kiem tra xem tren url co IDLoai kong ?IDLoai = ...
            {
                int IDLoai = int.Parse(Request.QueryString["IDLoai"]);//lay IDLoai tu url xuong
                List<BizSanPham> sanphams = BizSanPham.GetSanPhamByIDLoai(IDLoai);//lay list sp by  idloai
                categories1.Data = sanphams;// cho nay moi la dua data vao usercontrol
                BizLoaiSanPham LoaiSanPham = BizLoaiSanPham.GetLoaiSanPhamByID(IDLoai); // lay ra loai san phan by ID cua no
                categories1.Tieude = LoaiSanPham.TenLoai;//gan tieu de cua usercontrol = ten loai sp
            }

        }
    }
}
